package oop2;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class JavaTestClass {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        JavaClass jc = new JavaClass();
        System.out.println("新班开班");
        jc.name = "java83";
        jc.manageTeacher = "李老师";
        jc.dirTeacher = "老刘";
        jc.startDate = "2023-2-20";
        int choice = 0;
        while (true) {
            System.out.println("1:加新人，2：查看班级情况,3:查找,4:按照区间查找，9：退出");
            choice = in.nextInt();
            if (choice == 1) {
                System.out.print("请输入新人的名字：");
                String name = in.next();
                jc.add(name);
            } else if (choice == 2) {
                jc.selfIntro();
            } else if (choice == 3) {
                System.out.println("找谁？");
                String name = in.next();
                boolean insresult = jc.search(name);
                System.out.println(insresult ? "这个人在这个班" : "查无此人！");
            } else if (choice == 4) {
                //待实现
                //jc.search2("老吴",2,9);
                System.out.print("请输入起止数字：");
                int s=in.nextInt();
                int e=in.nextInt();
                System.out.print("找谁？");
                String n=in.next();
                boolean b = jc.search2(n, s, e);
                System.out.println(b?"在这个范围内":"范围内查无此人");
            } else if (choice == 9) {
                break;
            }
        }
    }
}
